/// @tags: DP wqs
#include <cstdio>
#include <iostream>

using namespace std;

namespace BlueQuantum {

int const N = 2e3 + 5;
double const eps = 1e-10;

int n, a, b, numa[N], numb[N];
double p[N], q[N], dp[N];

void solve(double ca, double cb) {
  for (int i = 1; i <= n; ++i) {
    dp[i] = numa[i] = numb[i] = 0;
    dp[i] = dp[i - 1];
    numa[i] = numa[i - 1];
    numb[i] = numb[i - 1];
    if (dp[i] < dp[i - 1] + p[i] - ca - eps) {
      dp[i] = dp[i - 1] + p[i] - ca;
      numa[i] = numa[i - 1] + 1;
      numb[i] = numb[i - 1];
    }
    if (dp[i] < dp[i - 1] + q[i] - cb - eps) {
      dp[i] = dp[i - 1] + q[i] - cb;
      numa[i] = numa[i - 1];
      numb[i] = numb[i - 1] + 1;
    }
    if (dp[i] < dp[i - 1] + p[i] - ca + q[i] - cb - p[i] * q[i] - eps) {
      dp[i] = dp[i - 1] + p[i] - ca + q[i] - cb - p[i] * q[i];
      numa[i] = numa[i - 1] + 1;
      numb[i] = numb[i - 1] + 1;
    }
  }
}

double check(double co) {
  double l = 0, r = 1, mid;
  for (int i = 1; i <= 50; ++i) {
    mid = (l + r) / 2;
    solve(co, mid);
    if (numb[n] > b) {
      l = mid;
    } else {
      r = mid;
    }
  }
  return l;
}

double v, ans;

inline int main() {
  cin >> n >> a >> b;
  for (int i = 1; i <= n; ++i) cin >> p[i];
  for (int i = 1; i <= n; ++i) cin >> q[i];
  double l = 0, r = 1, mid;
  for (int i = 1; i <= 50; ++i) {
    mid = (l + r) / 2;
    v = check(mid);
    if (numa[n] > a) l = mid;
    else
      r = mid;
  }
  solve(l, v);
  cout << dp[n] + l * a + v * b;
  return 0;
}

}  // namespace BlueQuantum

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("CF739E Gosha is hunting.in", "r", stdin);
  freopen("CF739E Gosha is hunting.out", "w", stdout);
#endif
#endif

  ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  return BlueQuantum::main();
}
